package day04;

import java.util.Random;
import java.util.Scanner;

public class WhileDemo {
    public static void main(String[] args) {
       /* int num=1;
        while (num<=9){
            System.out.println(num+"*9="+num*9);
            num++;
        }
        System.out.println("继续执行");

        int times=0;
        while (times<5){
            System.out.println("行动是成功的阶梯");
            times++;
        }*/
        Scanner scann=new Scanner(System.in);
        Random rand=new Random();
        int aa=rand.nextInt(100);
        System.out.println(aa);
       /* while (true){
            int bb=scann.nextInt();
            if (aa==bb){
                System.out.println("答对啦");
                break;
            }else if (aa>bb){
                System.out.println("猜小啦");
            }else {
                System.out.println("猜大啦");
            }
        }*/
         int dd;
        do {
            System.out.println("猜吧");
            dd=scann.nextInt();
           if (dd>aa){
               System.out.println("猜大啦");
           }else if(dd<aa){
               System.out.println("猜小啦");
           }else {
               System.out.println("猜对了");
           }

        }while (dd!=aa);


    }
}
